#pragma once
#include <stdio.h>
#include <string>
#include <stdint.h>

class File {
private:
	FILE* fp;
public:
	File(std::string filename, std::string mode);
	~File();
	operator FILE*();
};

class BinBuffer {
private:
	uint8_t* _data;
	uint64_t _length;
	uint64_t _size;
public:
	BinBuffer(uint64_t length = 0, uint64_t ptr = 0);
	BinBuffer(std::string str);
	BinBuffer(const BinBuffer& buffer);
	BinBuffer(BinBuffer&& buffer) noexcept;
	~BinBuffer();
	BinBuffer& operator=(const BinBuffer& binBuffer);
	BinBuffer& operator+=(BinBuffer& binBuffer);
	friend BinBuffer operator+(BinBuffer& bin1, BinBuffer& bin2);
	operator uint8_t*();
	uint64_t length();
	uint8_t& operator[](uint64_t ptr);
	const uint8_t& operator[](uint64_t ptr) const;
};

unsigned str2num(const std::string& strnum);